import { Component, Emit, Prop } from 'vue-facing-decorator'
import Render from '@/render/Render'
import toNative from '@/utils/toNative'
import type { DescItemDto } from '@/components/render-descriotion/Index'
import RenderDescription from '@/components/render-descriotion/Index'
import { EditOutlined, InfoCircleOutlined, UserOutlined } from '@ant-design/icons-vue'
import { getCompanyDetail, updateSaasCompany } from '@/api/company'
import { Button, message } from 'ant-design-vue'
import ToolTipText from '@/components/tooltip-text/Index'
import type { CompanyProductInfoDto, GroupInfoDto, PayWageInfoDto, WesureInfoDto } from '@/api/company/types'
import renderModal, { getModelValue, type FormModalDto } from '@/components/modal/Modal'
import { alipayWithdraw } from '@/api/customer'
import { DailyblockedAccountCnEnum } from '@/const/enum'
import DialogClaimRate from '../insurance-period/DialogClaimRate'

@Component
export class BasicInfo extends Render {
    @Prop() dailyInfo!: WesureInfoDto

    showClaimRate = false
    @Emit('refresh')
    handleRefresh() {}

    get clientInfoData() {
        return [
            {
                label: '所属销售',
                value: this.dailyInfo?.salesName,
            },
            {
                label: '账户余额',
                value: this.dailyInfo?.wesureBalance
            },
            {
                label: '开通时间',
                value: this.dailyInfo?.productOpenTime
            },
        ] as DescItemDto[]
    }

    render() {
        return <div>
            <div class="flex items-center mb-20px">
                <UserOutlined />
                <div class="text-black-200 font-bold ml-8px">发薪专户资料</div>
            </div>
            <RenderDescription labelWidth={140} renderData={this.clientInfoData} />
        </div>
    }
}

export default toNative<{dailyInfo: GroupInfoDto, companyProductInfo: CompanyProductInfoDto}, { refresh: () => void}>(BasicInfo)